home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / AppleGuide.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  10.8 KB  |  481 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleGuide.a
  3. ;
  4. ;    Contains:    Apple Guide Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    ©1994-1997 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__APPLEGUIDE__') = 'UNDEFINED' THEN
  19. __APPLEGUIDE__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  25.     include 'AppleEvents.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.  
  31.  
  32. ;  Types
  33. ; typedef UInt32                         AGRefNum
  34.  
  35. ; typedef UInt32                         AGCoachRefNum
  36.  
  37. ; typedef UInt32                         AGContextRefNum
  38.  
  39. AGAppInfo                RECORD 0
  40. eventId                     ds.l    1                ; offset: $0 (0)
  41. refCon                     ds.l    1                ; offset: $4 (4)
  42. contextObj                 ds.l    1                ; offset: $8 (8)        ;  private system field
  43. sizeof                     EQU *                    ; size:   $C (12)
  44.                         ENDR
  45. ; typedef struct AGAppInfo *            AGAppInfoPtr
  46.  
  47. ; typedef AGAppInfoPtr *                AGAppInfoHdl
  48.  
  49. ;  Constants
  50.  
  51.  
  52.  
  53. kAGDefault                        EQU        0
  54. kAGFrontDatabase                EQU        1
  55. kAGNoMixin                        EQU        -1
  56.  
  57.  
  58. kAGViewFullHowdy                EQU        1                    ; Full-size Howdy
  59. kAGViewTopicAreas                EQU        2                    ; Full-size Topic Areas
  60. kAGViewIndex                    EQU        3                    ; Full-size Index Terms
  61. kAGViewLookFor                    EQU        4                    ; Full-size Look-For (Search)
  62. kAGViewSingleHowdy                EQU        5                    ; Single-list-size Howdy
  63. kAGViewSingleTopics                EQU        6                    ; Single-list-size Topics
  64.  
  65.  
  66. kAGFileMain                        EQU        'poco'
  67. kAGFileMixin                    EQU        'mixn'
  68. ;  To test against AGGetAvailableDBTypes
  69.  
  70. kAGDBTypeBitAny                    EQU        $00000001
  71. kAGDBTypeBitHelp                EQU        $00000002
  72. kAGDBTypeBitTutorial            EQU        $00000004
  73. kAGDBTypeBitShortcuts            EQU        $00000008
  74. kAGDBTypeBitAbout                EQU        $00000010
  75. kAGDBTypeBitOther                EQU        $00000080
  76.  
  77. ; typedef UInt16                         AGStatus
  78.  
  79. ;  Returned by AGGetStatus
  80.  
  81. kAGIsNotRunning                    EQU        0
  82. kAGIsSleeping                    EQU        1
  83. kAGIsActive                        EQU        2
  84.  
  85. ; typedef UInt16                         AGWindowKind
  86.  
  87. ;  Returned by AGGetFrontWindowKind
  88.  
  89. kAGNoWindow                        EQU        0
  90. kAGAccessWindow                    EQU        1
  91. kAGPresentationWindow            EQU        2
  92. ;  Error Codes
  93.  
  94. ;  Not an enum, because other OSErrs are valid.
  95. ; typedef SInt16                         AGErr
  96.  
  97. ;  Apple Guide error codes
  98.  
  99.                                                             ; -------------------- Apple event reply codes
  100. kAGErrUnknownEvent                EQU        -2900
  101. kAGErrCantStartup                EQU        -2901
  102. kAGErrNoAccWin                    EQU        -2902
  103. kAGErrNoPreWin                    EQU        -2903
  104. kAGErrNoSequence                EQU        -2904
  105. kAGErrNotOopsSequence            EQU        -2905
  106. kAGErrReserved06                EQU        -2906
  107. kAGErrNoPanel                    EQU        -2907
  108. kAGErrContentNotFound            EQU        -2908
  109. kAGErrMissingString                EQU        -2909
  110. kAGErrInfoNotAvail                EQU        -2910
  111. kAGErrEventNotAvailable            EQU        -2911
  112. kAGErrCannotMakeCoach            EQU        -2912
  113. kAGErrSessionIDsNotMatch        EQU        -2913
  114. kAGErrMissingDatabaseSpec        EQU        -2914                ; -------------------- Coach's Chalkboard reply codes
  115. kAGErrItemNotFound                EQU        -2925
  116. kAGErrBalloonResourceNotFound    EQU        -2926
  117. kAGErrChalkResourceNotFound        EQU        -2927
  118. kAGErrChdvResourceNotFound        EQU        -2928
  119. kAGErrAlreadyShowing            EQU        -2929
  120. kAGErrBalloonResourceSkip        EQU        -2930
  121. kAGErrItemNotVisible            EQU        -2931
  122. kAGErrReserved32                EQU        -2932
  123. kAGErrNotFrontProcess            EQU        -2933
  124. kAGErrMacroResourceNotFound        EQU        -2934                ; -------------------- API reply codes
  125. kAGErrAppleGuideNotAvailable    EQU        -2951
  126. kAGErrCannotInitCoach            EQU        -2952
  127. kAGErrCannotInitContext            EQU        -2953
  128. kAGErrCannotOpenAliasFile        EQU        -2954
  129. kAGErrNoAliasResource            EQU        -2955
  130. kAGErrDatabaseNotAvailable        EQU        -2956
  131. kAGErrDatabaseNotOpen            EQU        -2957
  132. kAGErrMissingAppInfoHdl            EQU        -2958
  133. kAGErrMissingContextObject        EQU        -2959
  134. kAGErrInvalidRefNum                EQU        -2960
  135. kAGErrDatabaseOpen                EQU        -2961
  136. kAGErrInsufficientMemory        EQU        -2962
  137. ;  Events
  138.  
  139. ;  Not an enum because we want to make assignments.
  140. ; typedef UInt32                         AGEvent
  141.  
  142. ;  Handy events for AGGeneral.
  143.  
  144.                                                             ; Panel actions (Require a presentation window).
  145. kAGEventDoCoach                    EQU        'doco'
  146. kAGEventDoHuh                    EQU        'dhuh'
  147. kAGEventGoNext                    EQU        'gonp'
  148. kAGEventGoPrev                    EQU        'gopp'
  149. kAGEventHidePanel                EQU        'pahi'
  150. kAGEventReturnBack                EQU        'gobk'
  151. kAGEventShowPanel                EQU        'pash'
  152. kAGEventTogglePanel                EQU        'patg'
  153. ;  Functions
  154.  
  155.  
  156. ;   AGClose
  157. ;   Close the database associated with the AGRefNum.
  158.  
  159.  
  160.  
  161. ;
  162. ; pascal AGErr AGClose(AGRefNum *refNum)
  163. ;
  164.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  165.         Macro
  166.         _AGClose
  167.             moveq               #17,D0
  168.             dc.w                $AA6E
  169.         EndM
  170.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  171.         IMPORT_CFM_FUNCTION AGClose
  172.     ENDIF
  173.  
  174.  
  175. ;   AGGeneral
  176. ;   Cause various events to happen.
  177.  
  178.  
  179.  
  180. ;
  181. ; pascal AGErr AGGeneral(AGRefNum refNum, AGEvent theEvent)
  182. ;
  183.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  184.         Macro
  185.         _AGGeneral
  186.             moveq               #13,D0
  187.             dc.w                $AA6E
  188.         EndM
  189.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  190.         IMPORT_CFM_FUNCTION AGGeneral
  191.     ENDIF
  192.  
  193.  
  194. ;   AGGetAvailableDBTypes
  195. ;   Return the database types available for this application.
  196.  
  197.  
  198.  
  199. ;
  200. ; pascal UInt32 AGGetAvailableDBTypes(void )
  201. ;
  202.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  203.         Macro
  204.         _AGGetAvailableDBTypes
  205.             moveq               #8,D0
  206.             dc.w                $AA6E
  207.         EndM
  208.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  209.         IMPORT_CFM_FUNCTION AGGetAvailableDBTypes
  210.     ENDIF
  211.  
  212.  
  213. ;   AGGetFrontWindowKind
  214. ;   Return the kind of the front window.
  215.  
  216.  
  217.  
  218. ;
  219. ; pascal AGWindowKind AGGetFrontWindowKind(AGRefNum refNum)
  220. ;
  221.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  222.         Macro
  223.         _AGGetFrontWindowKind
  224.             moveq               #12,D0
  225.             dc.w                $AA6E
  226.         EndM
  227.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  228.         IMPORT_CFM_FUNCTION AGGetFrontWindowKind
  229.     ENDIF
  230.  
  231.  
  232. ;   AGGetFSSpec
  233. ;   Return the FSSpec for the AGRefNum.
  234.  
  235.  
  236.  
  237. ;
  238. ; pascal AGErr AGGetFSSpec(AGRefNum refNum, FSSpec *fileSpec)
  239. ;
  240.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  241.         Macro
  242.         _AGGetFSSpec
  243.             moveq               #15,D0
  244.             dc.w                $AA6E
  245.         EndM
  246.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  247.         IMPORT_CFM_FUNCTION AGGetFSSpec
  248.     ENDIF
  249.  
  250.  
  251. ;   AGGetStatus
  252. ;   Return the status of Apple Guide.
  253.  
  254.  
  255.  
  256. ;
  257. ; pascal AGStatus AGGetStatus(void )
  258. ;
  259.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  260.         Macro
  261.         _AGGetStatus
  262.             moveq               #9,D0
  263.             dc.w                $AA6E
  264.         EndM
  265.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  266.         IMPORT_CFM_FUNCTION AGGetStatus
  267.     ENDIF
  268.  
  269.  
  270. ;   AGInstallCoachHandler
  271. ;   Install a Coach object location query handler.
  272.  
  273.  
  274.  
  275. ;
  276. ; pascal AGErr AGInstallCoachHandler(CoachReplyUPP coachReplyProc, long refCon, AGCoachRefNum *resultRefNum)
  277. ;
  278.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  279.         Macro
  280.         _AGInstallCoachHandler
  281.             moveq               #18,D0
  282.             dc.w                $AA6E
  283.         EndM
  284.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  285.         IMPORT_CFM_FUNCTION AGInstallCoachHandler
  286.     ENDIF
  287.  
  288.  
  289. ;   AGInstallContextHandler
  290. ;   Install a context check query handler.
  291.  
  292.  
  293.  
  294. ;
  295. ; pascal AGErr AGInstallContextHandler(ContextReplyUPP contextReplyProc, AEEventID eventID, long refCon, AGContextRefNum *resultRefNum)
  296. ;
  297.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  298.         Macro
  299.         _AGInstallContextHandler
  300.             moveq               #19,D0
  301.             dc.w                $AA6E
  302.         EndM
  303.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  304.         IMPORT_CFM_FUNCTION AGInstallContextHandler
  305.     ENDIF
  306.  
  307.  
  308. ;   AGIsDatabaseOpen
  309. ;   Return true if the database associated with the AGRefNum is open.
  310.  
  311.  
  312.  
  313. ;
  314. ; pascal Boolean AGIsDatabaseOpen(AGRefNum refNum)
  315. ;
  316.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  317.         Macro
  318.         _AGIsDatabaseOpen
  319.             moveq               #6,D0
  320.             dc.w                $AA6E
  321.         EndM
  322.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  323.         IMPORT_CFM_FUNCTION AGIsDatabaseOpen
  324.     ENDIF
  325.  
  326.  
  327. ;   AGOpen
  328. ;   Open a guide database.
  329.  
  330.  
  331.  
  332. ;
  333. ; pascal AGErr AGOpen(ConstFSSpecPtr fileSpec, UInt32 flags, Handle mixinControl, AGRefNum *resultRefNum)
  334. ;
  335.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  336.         Macro
  337.         _AGOpen
  338.             moveq               #1,D0
  339.             dc.w                $AA6E
  340.         EndM
  341.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  342.         IMPORT_CFM_FUNCTION AGOpen
  343.     ENDIF
  344.  
  345.  
  346. ;   AGOpenWithSearch
  347. ;   Open a guide database and preset a search string.
  348.  
  349.  
  350.  
  351. ;
  352. ; pascal AGErr AGOpenWithSearch(ConstFSSpecPtr fileSpec, UInt32 flags, Handle mixinControl, ConstStr255Param searchString, AGRefNum *resultRefNum)
  353. ;
  354.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  355.         Macro
  356.         _AGOpenWithSearch
  357.             moveq               #2,D0
  358.             dc.w                $AA6E
  359.         EndM
  360.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  361.         IMPORT_CFM_FUNCTION AGOpenWithSearch
  362.     ENDIF
  363.  
  364.  
  365. ;   AGOpenWithSequence
  366. ;   Open a guide database and display a presentation window sequence.
  367.  
  368.  
  369.  
  370. ;
  371. ; pascal AGErr AGOpenWithSequence(ConstFSSpecPtr fileSpec, UInt32 flags, Handle mixinControl, short sequenceID, AGRefNum *resultRefNum)
  372. ;
  373.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  374.         Macro
  375.         _AGOpenWithSequence
  376.             moveq               #4,D0
  377.             dc.w                $AA6E
  378.         EndM
  379.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  380.         IMPORT_CFM_FUNCTION AGOpenWithSequence
  381.     ENDIF
  382.  
  383.  
  384. ;   AGOpenWithView
  385. ;   Open a guide database and override the default view.
  386.  
  387.  
  388.  
  389. ;
  390. ; pascal AGErr AGOpenWithView(ConstFSSpecPtr fileSpec, UInt32 flags, Handle mixinControl, short viewNum, AGRefNum *resultRefNum)
  391. ;
  392.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  393.         Macro
  394.         _AGOpenWithView
  395.             moveq               #5,D0
  396.             dc.w                $AA6E
  397.         EndM
  398.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  399.         IMPORT_CFM_FUNCTION AGOpenWithView
  400.     ENDIF
  401.  
  402.  
  403. ;   AGQuit
  404. ;   Make Apple Guide quit.
  405.  
  406.  
  407.  
  408. ;
  409. ; pascal AGErr AGQuit(void )
  410. ;
  411.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  412.         Macro
  413.         _AGQuit
  414.             moveq               #16,D0
  415.             dc.w                $AA6E
  416.         EndM
  417.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  418.         IMPORT_CFM_FUNCTION AGQuit
  419.     ENDIF
  420.  
  421.  
  422. ;   AGRemoveCoachHandler
  423. ;   Remove the Coach object location query handler.
  424.  
  425.  
  426.  
  427. ;
  428. ; pascal AGErr AGRemoveCoachHandler(AGCoachRefNum *resultRefNum)
  429. ;
  430.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  431.         Macro
  432.         _AGRemoveCoachHandler
  433.             moveq               #20,D0
  434.             dc.w                $AA6E
  435.         EndM
  436.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  437.         IMPORT_CFM_FUNCTION AGRemoveCoachHandler
  438.     ENDIF
  439.  
  440.  
  441. ;   AGRemoveContextHandler
  442. ;   Remove the context check query handler.
  443.  
  444.  
  445.  
  446. ;
  447. ; pascal AGErr AGRemoveContextHandler(AGContextRefNum *resultRefNum)
  448. ;
  449.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  450.         Macro
  451.         _AGRemoveContextHandler
  452.             moveq               #21,D0
  453.             dc.w                $AA6E
  454.         EndM
  455.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  456.         IMPORT_CFM_FUNCTION AGRemoveContextHandler
  457.     ENDIF
  458.  
  459.  
  460. ;   AGStart
  461. ;   Start up Apple Guide in the background.
  462.  
  463.  
  464.  
  465. ;
  466. ; pascal AGErr AGStart(void )
  467. ;
  468.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  469.         Macro
  470.         _AGStart
  471.             moveq               #10,D0
  472.             dc.w                $AA6E
  473.         EndM
  474.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  475.         IMPORT_CFM_FUNCTION AGStart
  476.     ENDIF
  477.  
  478.  
  479.     ENDIF ; __APPLEGUIDE__ 
  480.  
  481.